package se.citerus.dddsample.data;

import java.sql.Timestamp;

import org.springframework.jdbc.core.JdbcTemplate;

import se.citerus.dddsample.application.util.SampleDataGenerator;

public abstract class AbstractDataGenerator {

	protected void executeUpdate(JdbcTemplate jdbcTemplate, String sql, Object[][] args) {
		for (Object[] arg : args) {
			jdbcTemplate.update(sql, arg);
		}
	}

	protected Timestamp ts(int hours) {
		return new Timestamp(SampleDataGenerator.getBaseTime().getTime() + 1000L * 60 * 60 * hours);
	}

}
